$(function(){
	$('#mainportal').portal({
	    onStateChange:function(){
	        var state = getPortalState();
	        var date = new Date();
	        date.setTime(date.getTime() + 24*3600*1000);
	        document.cookie = 'portal-state='+state+';expires='+date.toGMTString();
	    }
	});
});